#include "backend/kernel_interface/kernel_scheduler.h"

namespace txdnn {

const std::unordered_map<fs::path, TXDNN_STR_VIEW, FsPathHash>& kernels() {
  static const std::unordered_map<fs::path, TXDNN_STR_VIEW, FsPathHash> data{
    // ${INIT_KERNELS}
    {fs::path("/usr/lib"), "rope"}
  };
  return data;
}

TXDNN_STR_VIEW GetKernelSrc(const fs::path& kernel_src) {
  auto it = kernels().find(kernel_src.filename());
  if (it == kernels().end()) {
    TXDNN_THROW("Failed to find kernel source: " + kernel_src.filename());
  }
  return it->second;
}

} // namespace txdnn